Skip to content

[log] Add debug logging to mcp/tool_result.go#2061

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/aw-go-logger-enhancement-debug
Draft

[log] Add debug logging to mcp/tool_result.go#2061
Copilot wants to merge 2 commits intomainfrom
copilot/aw-go-logger-enhancement-debug

Conversation

Copy link
Contributor

Copilot AI commented Mar 17, 2026

The "Go Logger Enhancement" agentic workflow failed because the agent made valid changes to internal/mcp/tool_result.go but couldn't validate or commit them — bash commands like make agent-finished and go build ./... were blocked by the workflow's strict tool allowlist, causing the job to exit without producing a patch.

Changes

  • ConvertToCallToolResult — added entry log and success log (reports content_items and is_error)
  • ParseToolArguments — added entry log (tool name) and success log (argument count); previously had zero logging calls

Uses the existing logToolResult = logger.New("mcp:tool_result") logger; no new imports or declarations needed.

func ConvertToCallToolResult(data interface{}) (*sdk.CallToolResult, error) {
    logToolResult.Print("Converting backend result to CallToolResult")
    // ...
    logToolResult.Printf("Converted result: content_items=%d, is_error=%v", len(content), backendResult.IsError)
    return &sdk.CallToolResult{...}, nil
}

func ParseToolArguments(req *sdk.CallToolRequest) (map[string]interface{}, error) {
    logToolResult.Printf("Parsing arguments for tool: %s", req.Params.Name)
    // ...
    logToolResult.Printf("Parsed %d arguments for tool: %s", len(toolArgs), req.Params.Name)
    return toolArgs, nil
}

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • example.com
    • Triggering command: /tmp/go-build4231811108/b332/launcher.test /tmp/go-build4231811108/b332/launcher.test -test.testlogfile=/tmp/go-build4231811108/b332/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4231811108/b270/vet.cfg ache/go/1.25.8/x64/src/runtime/c-c=4 _cgo_.o x_amd64/vet OUTPUT -d 168.63.129.16 x_amd64/vet --de�� 64/src/net --log-level x_amd64/vet --log-target journal-or-kmsg (dns block)
  • invalid-host-that-does-not-exist-12345.com
    • Triggering command: /tmp/go-build4231811108/b317/config.test /tmp/go-build4231811108/b317/config.test -test.testlogfile=/tmp/go-build4231811108/b317/testlog.txt -test.paniconexit0 -test.timeout=10m0s --no�� 64/src/runtime/cgo (dns block)
  • nonexistent.local
    • Triggering command: /tmp/go-build4231811108/b332/launcher.test /tmp/go-build4231811108/b332/launcher.test -test.testlogfile=/tmp/go-build4231811108/b332/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4231811108/b270/vet.cfg ache/go/1.25.8/x64/src/runtime/c-c=4 _cgo_.o x_amd64/vet OUTPUT -d 168.63.129.16 x_amd64/vet --de�� 64/src/net --log-level x_amd64/vet --log-target journal-or-kmsg (dns block)
  • slow.example.com
    • Triggering command: /tmp/go-build4231811108/b332/launcher.test /tmp/go-build4231811108/b332/launcher.test -test.testlogfile=/tmp/go-build4231811108/b332/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build4231811108/b270/vet.cfg ache/go/1.25.8/x64/src/runtime/c-c=4 _cgo_.o x_amd64/vet OUTPUT -d 168.63.129.16 x_amd64/vet --de�� 64/src/net --log-level x_amd64/vet --log-target journal-or-kmsg (dns block)
  • this-host-does-not-exist-12345.com
    • Triggering command: /tmp/go-build4231811108/b341/mcp.test /tmp/go-build4231811108/b341/mcp.test -test.testlogfile=/tmp/go-build4231811108/b341/testlog.txt -test.paniconexit0 -test.timeout=10m0s @v1.�� 64/src/net ache/go/1.25.8/x64/src/net/netip/netip.go x_amd64/compile -p crypto/internal//usr/bin/runc -lang=go1.25 x_amd64/compile -I /opt/hostedtoolcache/go/1.25.8/x64/src/runtime/c-p 4742298/b100/ x_amd64/vet -pthread -Wl,--no-gc-sectinspect -fmessage-length--format x_amd64/vet (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Send tasks to Copilot coding agent from Slack and Teams to turn conversations into code. Copilot posts an update in your thread when it's finished.

Copilot AI linked an issue Mar 17, 2026 that may be closed by this pull request
Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
Copilot AI changed the title [WIP] [aw] Debug Go Logger Enhancement workflow failure [log] Add debug logging to mcp/tool_result.go Mar 17, 2026
Copilot AI requested a review from lpcox March 17, 2026 16:55
lpcox added a commit that referenced this pull request Mar 19, 2026
…sue (#2158)

## Summary

Adds a **Guard Filtering Summary** section to the repo-assist Monthly
Activity Issue so maintainers can see what objects the guard policy
blocked during each run.

## What it looks like

When the guard filters objects, the monthly activity issue will include:

```markdown
## Guard Filtering Summary

| Type | Count | Resources |
|------|-------|-----------|
| Issues | 7 | #1711, #2049, #2086, #2087, #2089, #2093, #2100 |
| PRs | 7 | #2037, #2042, #2061, #2063, #2064, #2092, #2096 |
| Other | 2 | actions_list, get_repository_tree |

**Policy**: `repos: [github/*], min-integrity: merged`
**Total filtered**: 54 items across 17 tool calls
```

When no filtering occurs, it states "No objects were filtered by the
guard policy."

## How it works

1. **New section in issue template** — "Guard Filtering Summary" sits
between "Future Work" and "Run History"
2. **New step 6** — Agent reads `/tmp/gh-aw/mcp-logs/rpc-messages.jsonl`
via bash, parses `DIFC_FILTERED` entries, groups by type
(issues/PRs/other), deduplicates across tool calls
3. **Python one-liner** — Extracts resource descriptions, groups into a
JSON summary the agent uses to populate the template

## Motivation

From [run
23274488766](https://github.com/github/gh-aw-mcpg/actions/runs/23274488766),
54 objects were silently filtered with `min-integrity: merged`. The
agent reported "GitHub API access to private repo issues unavailable"
without understanding why. This change gives both the agent and
maintainers explicit visibility into guard policy impact.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[aw] Go Logger Enhancement failed

2 participants